﻿package mortal.game.scene3D.display3d.icon3d
{
    import frEngine.shader.*;
    import frEngine.shader.filters.*;
    import frEngine.shader.filters.vertexFilters.*;
    import frEngine.shader.filters.vertexFilters.def.*;

    public class Icon3DVertexFilter extends VertexFilter
    {

        public function Icon3DVertexFilter()
        {
            super(-1, null);
            return;
        }// end function

        override public function setRegisterParams(param1:Program3dRegisterInstance) : void
        {
            return;
        }// end function

        override public function get programeId() : String
        {
            return "iconVertexFilter0";
        }// end function

        override public function createVertexCode(param1:Program3dRegisterInstance, param2:int) : String
        {
            var _loc_3:Array = [];
            _loc_3.push(new ToBuilderInfo("vc0-100", "{iconPosList}", false, 100, []));
            _loc_3.push(new ToBuilderInfo("va0", FilterName.POSITION, false, 3));
            _loc_3.push(new ToBuilderInfo("va1", FilterName.SKIN_INDICES, false, 2));
            _loc_3.push(new ToBuilderInfo("vf0", "{v_iconRate}", false, 1));
            var _loc_4:String = "";
            _loc_4 = _loc_4 + "mov           vt0    \t\t\t\tvc[va1.x]  \t\t\t\t\t\t\n";
            _loc_4 = _loc_4 + "mov           vt1    \t\t\t\tvc[va1.y]  \t\t\t\t\t\t\n";
            _loc_4 = _loc_4 + "mul           {output}    \t\t\tva0.xyz  \t\t\tvt1.xyy\t\t\t\n";
            _loc_4 = _loc_4 + "add           {output}    \t\t\tvt0         \t\t{output}  \t\t\n";
            _loc_4 = _loc_4 + "sge           vt0.z    \t\t\tvt0.w  \t\t\t{vcConst1}.x\t\t\n";
            _loc_4 = _loc_4 + "mul           {output}    \t\t\t{output}        \tvt0.z  \t\t\t\n";
            _loc_4 = _loc_4 + "mov           {output}.w    \t\t{vcConst1}.z  \t\t\t\t\t\t\n";
            _loc_4 = _loc_4 + "mov           vf0    \t\t\t\tvt1  \t\t\t\t\t\t\t\t\n";
            _loc_4 = param1.toBuild(_loc_4, _loc_3);
            param1.OpType = ECalculateOpType.ViewProj;
            return _loc_4;
        }// end function

    }
}
